// 用户相关类型
export interface User {
  id: string;
  name: string;
  email: string;
  avatar?: string;
  phone?: string;
  createdAt?: string;
  updatedAt?: string;
}

// 认证相关类型
export interface AuthState {
  user: User | null;
  token: string | null;
  isAuthenticated: boolean;
  isLoading: boolean;
  error: string | null;
}

export interface LoginCredentials {
  email: string;
  password: string;
}

export interface RegisterCredentials {
  name: string;
  email: string;
  password: string;
  confirmPassword: string;
}

// 应用设置类型
export interface AppSettings {
  theme: 'light' | 'dark' | 'system';
  language: string;
  notifications: boolean;
  autoUpdate: boolean;
}

export interface AppState {
  isLoading: boolean;
  isOnline: boolean;
  theme: 'light' | 'dark' | 'system';
  language: string;
  notifications: boolean;
}

// 主题相关类型
export interface ThemeColors {
  primary: string;
  secondary: string;
  background: string;
  surface: string;
  text: string;
  textSecondary: string;
  border: string;
  error: string;
  success: string;
  warning: string;
}

export interface ThemeContextType {
  theme: 'light' | 'dark';
  isDark: boolean;
  colors: ThemeColors;
}

// 导航相关类型
export interface RootStackParamList {
  Auth: undefined;
  Main: undefined;
  Loading: undefined;
}

export interface AuthStackParamList {
  Login: undefined;
  Register: undefined;
  ForgotPassword: undefined;
}

export interface MainTabParamList {
  Home: undefined;
  Add: undefined;
  Profile: undefined;
  Settings: undefined;
}

// API 响应类型
export interface ApiResponse<T = any> {
  success: boolean;
  data?: T;
  message?: string;
  error?: string;
}

export interface PaginatedResponse<T> {
  data: T[];
  total: number;
  page: number;
  limit: number;
  totalPages: number;
}

// 表单相关类型
export interface FormField {
  value: string;
  error?: string;
  touched: boolean;
}

export interface FormState {
  [key: string]: FormField;
}

// 通用类型
export interface LoadingState {
  isLoading: boolean;
  error: string | null;
}

export interface SelectOption {
  label: string;
  value: string | number;
}

// 组件 Props 类型
export interface BaseComponentProps {
  style?: any;
  children?: React.ReactNode;
}

// 事件类型
export interface TouchEvent {
  target: any;
  currentTarget: any;
}

// 平台特定类型
export interface PlatformConfig {
  isIOS: boolean;
  isAndroid: boolean;
  version: string;
}

// 存储相关类型
export interface StorageData {
  [key: string]: any;
}

// 验证相关类型
export interface ValidationResult {
  isValid: boolean;
  errors: string[];
}

// 网络相关类型
export interface NetworkState {
  isConnected: boolean;
  type: string;
}

// 通知相关类型
export interface Notification {
  id: string;
  title: string;
  body: string;
  data?: any;
  timestamp: number;
  read: boolean;
}

// 错误类型
export interface AppError {
  code: string;
  message: string;
  details?: any;
}

// 日志类型
export interface LogEntry {
  level: 'debug' | 'info' | 'warn' | 'error';
  message: string;
  timestamp: number;
  data?: any;
}

// 性能监控类型
export interface PerformanceMetric {
  name: string;
  duration: number;
  timestamp: number;
  metadata?: any;
}

// 车辆相关类型
export interface Vehicle {
  id: string;
  title: string;
  brand: string;
  model: string;
  year: number;
  mileage: number;
  price: number;
  description: string;
  images: string[];
  videos: string[];
  condition: 'excellent' | 'good' | 'fair' | 'poor';
  fuelType: 'gasoline' | 'diesel' | 'electric' | 'hybrid' | 'other';
  transmission: 'manual' | 'automatic' | 'cvt';
  bodyType: 'sedan' | 'suv' | 'hatchback' | 'wagon' | 'coupe' | 'convertible' | 'pickup' | 'van' | 'other';
  color: string;
  engineSize: string;
  power: string;
  features: string[];
  location: {
    city: string;
    province: string;
    address: string;
  };
  seller: {
    id: string;
    name: string;
    phone: string;
    avatar?: string;
  };
  status: 'active' | 'sold' | 'pending' | 'expired';
  createdAt: string;
  updatedAt: string;
}

export interface VehicleFormData {
  title: string;
  brand: string;
  model: string;
  year: string;
  mileage: string;
  price: string;
  description: string;
  condition: string;
  fuelType: string;
  transmission: string;
  bodyType: string;
  color: string;
  engineSize: string; // 用于电池容量
  power: string; // 用于续航里程
  features: string[];
  city: string;
  province: string;
  address: string;
  batteryHealth?: string; // 电池健康度
  chargingType?: string; // 充电类型
  warrantyInfo?: string; // 保修信息
}

export interface VehicleBrand {
  id: string;
  name: string;
  logo?: string;
  country: string;
}

export interface VehicleModel {
  id: string;
  brandId: string;
  name: string;
  category: string;
}

export interface MediaFile {
  id: string;
  uri: string;
  type: 'image' | 'video';
  name: string;
  size: number;
  uploaded: boolean;
}

 